﻿/*
 * Created by SharpDevelop.
 * User: IEscarro
 * Date: 9/3/2009
 * Time: 2:58 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
using Buaya.Model;

namespace Buaya.Gui
{
	/// <summary>
	/// Description of TimesheetListForm.
	/// </summary>
	public partial class TimesheetListForm : Form
	{
		public TimesheetListForm()
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
		}
		
		void ButtonGoClick(object sender, EventArgs e)
		{
			IList<Timesheet> sheets = SessionFacade.FindTimesheetsByDate(dateTimePickerFrom.Value, dateTimePickerTo.Value);
			listView1.Items.Clear();
			foreach (Timesheet t in sheets) {
				ListViewItem li = listView1.Items.Add(t.Employee.Name.ToString());
				li.SubItems.Add(t.Date.ToString());
				li.SubItems.Add(t.In ? "In" : "Out"); 
			}
		}
	}
}
